#include <iostream>

using namespace std;
using ll = long long;

void solve() {
	int k, x;
	cin >> k >> x;
	ll ans = x;
	while (k-- > 0) {
		ans *= 2;
	}
	cout << ans << endl;
}

int main() {
	int t;
	cin >> t;
	while (t-- > 0) {
		solve();
	}
	return 0;
}
